#!/bin/bash
#delete previous files
export PYENV_VERSION=2.7.6

rm -r segfaultexample.py segfaultexample_wrap.c segfaultexample_wrap.o segfaultexample.o _segfaultexample.so

swig -python segfaultexample.i
gcc -c segfaultexample.c segfaultexample_wrap.c -I/home/local/MSI/ysun/.pyenv/versions/2.7.6/include/python2.7
ld -shared segfaultexample.o segfaultexample_wrap.o -o _segfaultexample.so

#run test
bash segmentfault.sh